﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
namespace Sbook.Data
{
    public class PublisherInfo
    {
        #region[Declare variables]
        private string _PId;
        private string _PCode;
        private string _PName;
        private string _PAddress;
        private string _PPhone;
        private string _PFax;
        #endregion
        #region[Public Properties]
        public string PId { get { return _PId; } set { _PId = value; } }
        public string PCode { get { return _PCode; } set { _PCode = value; } }
        public string PName { get { return _PName; } set { _PName = value; } }
        public string PAddress { get { return _PAddress; } set { _PAddress = value; } }
        public string PPhone { get { return _PPhone; } set { _PPhone = value; } }
        public string PFax { get { return _PFax; } set { _PFax = value; } }
        #endregion
        #region[Publisher IDataReader]
        public PublisherInfo PublisherIDataReader(IDataReader dr)
        {
            Data.PublisherInfo obj = new Data.PublisherInfo();
            obj.PId = (dr["PId"] is DBNull) ? string.Empty : dr["PId"].ToString();
            obj.PCode = (dr["PCode"] is DBNull) ? string.Empty : dr["PCode"].ToString();
            obj.PName = (dr["PName"] is DBNull) ? string.Empty : dr["PName"].ToString();
            obj.PAddress = (dr["PAddress"] is DBNull) ? string.Empty : dr["PAddress"].ToString();
            obj.PPhone = (dr["PPhone"] is DBNull) ? string.Empty : dr["PPhone"].ToString();
            obj.PFax = (dr["PFax"] is DBNull) ? string.Empty : dr["PFax"].ToString();
            return obj;
        }
        #endregion
    }
}